package com.itluma.isWOak.controller;

import com.github.pagehelper.PageInfo;


import com.itluma.isWOak.pojo.NewAccount;
import com.itluma.isWOak.pojo.NewService;
import com.itluma.isWOak.service.ClientTimeService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

@Controller

public class ClientTimeController {

    @Autowired
    private ClientTimeService clientTimeService;




    @RequestMapping("/report/report_list")
    //客户 1
    public String list1(HttpServletRequest request, @RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "1") Integer limit,Model model,NewAccount newAccount) {

        PageInfo<NewAccount> pageInfo = clientTimeService.page1(page, limit);
        System.out.println(pageInfo.getList());
       model.addAttribute("pageInfo",pageInfo);
        return "report/report_list";
    }

    @RequestMapping("/report/time_list")
    //时长 2
    public String list3(HttpServletRequest request, @RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "1") Integer limit,Model model,NewAccount newAccount) {


        PageInfo<NewAccount> pageInfo = clientTimeService.page2(page, limit);
        System.out.println(pageInfo.getList());
        model.addAttribute("pageInfo",pageInfo);
        return "report/time_list";
    }


    @RequestMapping("/report/charge_list")
    //资费 3
    public String list2(HttpServletRequest request, @RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "1") Integer limit,Model model,NewAccount newAccount) {

        PageInfo<NewAccount> pageInfo = clientTimeService.page3(page, limit);
        System.out.println(pageInfo.getList());
        model.addAttribute("pageInfo",pageInfo);
        return "report/charge_list";
    }








}